﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Sisocana.Core.Models.SearchPersonViewModel>" %>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />

<fieldset>
    <%= Html.Div("editor-label", Html.LabelFor(model => model.FirstName)) %>
    <%= Html.Div("editor-field", Html.EditorFor(model => model.FirstName)) %>
    <%= Html.ValidationMessageFor(model => Model.FirstName) %>

    <%= Html.Div("editor-label", Html.LabelFor(model => model.LastName)) %>
    <%= Html.Div("editor-field", Html.EditorFor(model => model.LastName))%>
    <%= Html.ValidationMessageFor(model => Model.LastName) %>

    <%= Html.Div("editor-label", Html.LabelFor(model => model.Phone)) %>
    <%= Html.Div("editor-field", Html.EditorFor(model => model.Phone))%>
    <%= Html.ValidationMessageFor(model => Model.Phone) %>

    <%= Html.Div("editor-label", Html.LabelFor(model => model.FromDateMissing)) %>
    <%= Html.Div("editor-field", Html.HiddenFor(model => model.FromDateMissing))%>
    <%= Html.Div("editor-field", Html.EditorFor(model => model.FromDateMissing.Date))%>
    <%= Html.ValidationMessageFor(model => Model.FromDateMissing) %>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $(document).ready(function () {
                $("#FromDateMissing_Date").datepicker({ dateFormat: 'mm-dd-yy',
                    onClose: function (dateText, inst) {
                        //copio el valor al hidden
                        $("#FromDateMissing").val(dateText);
                    }
                });
            });
        });
    </script>

    <%= Html.Div("editor-label", Html.LabelFor(model => model.ToDateMissing)) %>
    <%= Html.Div("editor-field", Html.HiddenFor(model => model.ToDateMissing))%>
    <%= Html.Div("editor-field", Html.EditorFor(model => model.ToDateMissing.Date))%>         
    <%= Html.ValidationMessageFor(model => Model.ToDateMissing) %>
    
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#ToDateMissing_Date").datepicker({ dateFormat: 'mm-dd-yy',
                onClose: function (dateText, inst) {
                    //copio el valor al hidden
                     $("#ToDateMissing").val(dateText);
                }
            });
        });


    </script>
</fieldset>
<tr>
    <td>
        <input type="submit" value="Search" />
    </td>
</tr>
